//import net.minecraft.client.Minecraft;

public class MCThread implements Runnable {
  private boolean running = false;
  private gj mainhook;
  private boolean invuln = false;
  private boolean oxygen = false;
  private boolean KKLI = false;
  private boolean fly = false;
  private boolean hover = false;
  private Status timeofday = Status.C;
  private Direction movement = Direction.I;

  //public MCThread(gi paramgi, Minecraft paramMinecraft, cx paramcx, dz paramdz, ia paramia)
  //{
  //  super(paramMinecraft, paramgi.e, paramgi.i, paramia);
  //  this.mainhook = paramgi;
 // }

  public MCThread(gj paramgj)
  {
    //super(paramMinecraft, paramgi.e, paramgi.i, paramia);
    this.mainhook = paramgj;
  }

  public void mo() {

  }
  //1.2.2 - g = lr
  //1.2.3 - g = lu
  //1.2.4 - g = lv
  //1.2.6 - g = lw

  public final void run()
  {
    while (this.running)
    {
      if (check())
      {
        long tod = this.mainhook.e.e; //unchanged.
        //Fly
        if (this.fly)
        {
          this.mainhook.g.aH = true; //On Ground?
          this.mainhook.g.aU = 0.0F; //Fall distance.
        }
        //Hover
        if (this.hover)
          this.mainhook.g.aA = 0.0D;
        if (this.invuln)
        {
            //he.class
            //Last function, a(byte), accepts a byte from the server to determine death.
          this.mainhook.g.J = 20; //Health
          this.mainhook.g.L = 0; //HurtTime
          this.mainhook.g.O = 0; //DeathTime
        }
        if (this.oxygen)
          this.mainhook.g.bk = 300; //Oxygen
        if (this.KKLI)
          this.mainhook.g.bg = 0; //Fire proof
        if (!this.movement.equals(Direction.I))
        {
          mainhook.g.az *= 1.1;
          mainhook.g.aB *= 1.1;
          if (mainhook.g.az < -0.7D) {
              mainhook.g.az = -0.7D;
          }
          if (mainhook.g.az > 0.7D) {
              mainhook.g.az = 0.7D;
          }
          if (mainhook.g.aB < -0.7D) {
              mainhook.g.aB = -0.7D;
          }
          if (mainhook.g.aB > 0.7D) {
              mainhook.g.aB = 0.7D;
          } 
        }
        if (this.timeofday.equals(Status.I))
        {
          if (tod % 24000L >= 12000L)
            this.mainhook.e.e = ((tod / 24000L + 1L) * 24000L);
        }
        else if ((this.timeofday.equals(Status.Z)) && (tod % 24000L < 12000L))
          this.mainhook.e.e = ((tod / 24000L + 1L) * 24000L + 16000L);
      }
      D(10);
    }
  }

  public final void startthread()
  {
    this.running = true;
    new Thread(this).start();
  }

  private static void D(int paramInt)
  {
    try
    {
      Thread.sleep(paramInt);
    }
    catch (InterruptedException localInterruptedException)
    {
    }
  }

  public final void I(boolean paramBoolean)
  {
    if (paramBoolean)
      this.invuln = true;
    else
      this.invuln = false;
  }

  public final void Z(boolean paramBoolean)
  {
    if (paramBoolean)
      this.oxygen = true;
    else
      this.oxygen = false;
  }

  public final void C(boolean paramBoolean)
  {
    if (paramBoolean)
      this.KKLI = true;
    else
      this.KKLI = false;
  }

  public final void B(boolean paramBoolean)
  {
    if (paramBoolean)
      this.fly = true;
    else
      this.fly = false;
  }

  public final void D(boolean paramBoolean)
  {
    if (paramBoolean)
      this.hover = true;
    else
      this.hover = false;
  }

  public final void I(Direction paramDirection)
  {
    this.movement = paramDirection;
  }

  public final void I(Status paramStatus)
  {
    this.timeofday = paramStatus;
  }

  private boolean check()
  {
    return (this.mainhook.e != null) && (this.mainhook.g != null) && (this.mainhook.g.e != null);
  }

  public void a(String paramString) {
      
  }
}